﻿using System.Threading.Tasks;

namespace K9Nano.Xlsx;

public interface IXlsxHandler
{
    /// <summary>
    /// 导出数据
    /// </summary>
    /// <param name="records">带导出的数据</param>
    /// <returns>是否导出成功</returns>
    Task<string> ExportAsync(object records, CancellationToken cancellation = default);

    /// <summary>
    /// 导入数据
    /// </summary>
    Task<ImportResult> ImportAsync(Stream xlsxFile);

    /// <summary>
    /// 导出数据模板
    /// </summary>
    /// <returns>是否导出成功</returns>
    Task<string> ExportTemplateAsync(CancellationToken cancellation = default);
}